package Underworld_Survival;

import java.io.Serializable;
import java.util.function.Consumer;

public class EquipmentEffect implements Serializable {
    private final Consumer<Role> onEquip;
    private final Consumer<Role> onUnequip;

    public EquipmentEffect(Consumer<Role> onEquip,
                           Consumer<Role> onUnequip) {
        this.onEquip = onEquip;
        this.onUnequip = onUnequip;
    }

    public void apply(Role role) { onEquip.accept(role); }
    public void revert(Role role) { onUnequip.accept(role); }

}